package com.aegean.onlinebook.service.action;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.aegean.onlinebook.model.SmallType;
import com.aegean.onlinebook.service.business.ServiceBusiness;
import com.opensymphony.xwork2.ActionSupport;
@Controller("SmallTypeAction")
@Scope("prototype")
public class SmallTypeAction extends ActionSupport {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Resource
	ServiceBusiness business;
	private String big_Name;
	private List<SmallType> smalltypes;
	private int total;
	private int start;
	private int limit;
	public int getTotal() {
		return total;
	}
	public void setTotal(int total) {
		this.total = total;
	}
	public int getStart() {
		return start;
	}
	public void setStart(int start) {
		this.start = start;
	}
	public int getLimit() {
		return limit;
	}
	public void setLimit(int limit) {
		this.limit = limit;
	}
	public String getBig_Name() {
		return big_Name;
	}
	public void setBig_Name(String big_Name) {
		this.big_Name = big_Name;
	}
	public List<SmallType> getSmalltypes() {
		return smalltypes;
	}
	public void setSmalltypes(List<SmallType> smalltypes) {
		this.smalltypes = smalltypes;
	}
	@Override
	public String execute() throws Exception {
		total=business.searchSmallTypeCount(big_Name);
		smalltypes=business.searchPartSmallTypes(big_Name, start, limit);
		return SUCCESS;
	}
	

}
